package com.yf.web.aspect;

import com.yf.ability.log.TopLogAspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 日志过滤
 * @author bool
 */
@Order(2)
@Aspect
@Component
public class LogAspect {


    @Autowired
    private TopLogAspect topLogAspect;


    /**
     * 针对注解过的方法，进行保存日志
     * @param jp
     * @return
     * @throws Throwable
     */
    @Around("@annotation(com.yf.ability.log.annon.LogInject)")
    public Object doAround(ProceedingJoinPoint jp) throws Throwable {
       return topLogAspect.record(jp);
    }


}
